import Main from './views/main.vue'
import Login from './views/index.vue'

const routers = [
    {
        path: '/',
        name: 'login',
        meta: {
            title: '登陆'
        },
        component: Login
    },
    {
        path: '/main',
        meta: {
            title: ''
        },
        name: 'main',
        component: Main,
        children: [
            {
                path: '/sy',
                name: 'sy',
                meta: {
                    title: '首页'
                },
                component: (resolve) => require(['./views/home/home.vue'], resolve)
            },
            {
                path: '/main/customer',
                name: 'customer',
                meta: {
                    title: '客户管理'
                },
                component: (resolve) => require(['./views/customer/customer.vue'], resolve)
            },
            {
                path: '/main/staff',
                name: 'staff',
                meta: {
                    title: '员工管理'
                },
                component: (resolve) => require(['./views/staff/staff.vue'], resolve)
            },
            {
                path: '/main/front',
                name: 'front',
                meta: {
                    title: '前道工艺库'
                },
                component: (resolve) => require(['./views/process/front.vue'], resolve)
            },
            {
                path: '/main/glue',
                name: 'glue',
                meta: {
                    title: '涂胶工艺库'
                },
                component: (resolve) => require(['./views/process/glue.vue'], resolve)
            },
            {
                path: '/main/flyhair',
                name: 'flyhair',
                meta: {
                    title: '飞毛工艺库'
                },
                component: (resolve) => require(['./views/process/flyhair.vue'], resolve)
            },
            {
                path: '/main/plastic',
                name: 'plastic',
                meta: {
                    title: '贴塑工艺库'
                },
                component: (resolve) => require(['./views/process/plastic.vue'], resolve)
            },
            {
                path: '/main/addglue',
                name: 'addglue',
                meta: {
                    title: '加胶工艺库'
                },
                component: (resolve) => require(['./views/process/addglue.vue'], resolve)
            },
            {
                path: '/main/gum',
                name: 'gum',
                meta: {
                    title: '背胶工艺库'
                },
                component: (resolve) => require(['./views/process/gum.vue'], resolve)
            },
            {
                path: '/main/strip',
                name: 'strip',
                meta: {
                    title: '分条工艺库'
                },
                component: (resolve) => require(['./views/process/strip.vue'], resolve)
            },
            {
                path: '/main/cutting',
                name: 'cutting',
                meta: {
                    title: '分切工艺库'
                },
                component: (resolve) => require(['./views/process/cutting.vue'], resolve)
            },
            {
                path: '/main/diecut',
                name: 'diecut',
                meta: {
                    title: '模切工艺库'
                },
                component: (resolve) => require(['./views/process/diecut.vue'], resolve)
            },
            {
                path: '/main/finalize',
                name: 'finalize',
                meta: {
                    title: '定型工艺库'
                },
                component: (resolve) => require(['./views/process/finalize.vue'], resolve)
            },
            {
                path: '/main/pack',
                name: 'pack',
                meta: {
                    title: '包装工艺库'
                },
                component: (resolve) => require(['./views/process/pack.vue'], resolve)
            },
            {
                path: '/main/product',
                name: 'product',
                meta: {
                    title: '产品管理'
                },
                component: (resolve) => require(['./views/product/product.vue'], resolve)
            },
            {
                path: '/main/order',
                name: 'order',
                meta: {
                    title: '订单管理'
                },
                component: (resolve) => require(['./views/order/order.vue'], resolve)
            },
            {
                path: '/main/stock',
                name: 'stock',
                meta: {
                    title: '库存管理'
                },
                component: (resolve) => require(['./views/warehouse/stock.vue'], resolve)
            },
            {
                path: '/main/materiel',
                name: 'materiel',
                meta: {
                    title: '物料管理'
                },
                component: (resolve) => require(['./views/warehouse/materiel.vue'], resolve)
            },
            {
                path: '/main/selfcheck',
                name: 'selfcheck',
                meta: {
                    title: '自检记录'
                },
                component: (resolve) => require(['./views/quality/selfcheck.vue'], resolve)
            },
            {
                path: '/main/qualitytest',
                name: 'qualitytest',
                meta: {
                    title: '质检管理'
                },
                component: (resolve) => require(['./views/quality/qualitytest.vue'], resolve)
            },
            {
                path: '/main/qualitycomplaint',
                name: 'qualitycomplaint',
                meta: {
                    title: '客诉管理'
                },
                component: (resolve) => require(['./views/quality/qualitycomplaint.vue'], resolve)
            },
            {
                path: '/main/device',
                name: 'device',
                meta: {
                    title: '设备管理'
                },
                component: (resolve) => require(['./views/device/device.vue'], resolve)
            },
            {
                path: '/main/maintenancerecord/:id/key/:key',
                name: 'maintenancerecord',
                meta: {
                    title: '维保记录'
                },
                component: (resolve) => require(['./views/device/maintenancerecord.vue'], resolve)
            },
            {
                path: '/main/produce',
                name: 'produce',
                meta: {
                    title: '生产管理'
                },
                component: (resolve) => require(['./views/produce/produce.vue'], resolve)
            },
            {
                path: '/main/workorder/:id/key/:key',
                name: 'workorder',
                meta: {
                    title: '工单详情'
                },
                component: (resolve) => require(['./views/workorder/workorder.vue'], resolve)
            },
            {
                path: '/main/basic',
                name: 'basicproduct',
                meta: {
                    title: '产品基本信息'
                },
                component: (resolve) => require(['./views/technology/basicproduct.vue'], resolve),
            },
            {
                path: '/main/bz',
                name: 'bzproduct',
                meta: {
                    title: '产品步骤配置'
                },
                component: (resolve) => require(['./views/technology/bzproduct.vue'], resolve),
            },
            {
                path: '/main/addproduct',
                name: 'addproduct',
                meta: {
                    title: '添加产品'
                },
                component: (resolve) => require(['./views/technology/addproduct.vue'], resolve)
            },
            {
                path: '/main/productversion/:id/key/:key',
                name: 'productversion',
                meta: {
                    title: '版本详情'
                },
                component: (resolve) => require(['./views/product/productversion.vue'], resolve)
            },
            {
                path: '/main/technology/:id',
                name: 'technology',
                meta: {
                    title: '工艺管理'
                },
                component: (resolve) => require(['./views/product/technology.vue'], resolve)
            },
            {
                path: '/main/productbom/:id',
                name: 'productbom',
                meta: {
                    title: 'BOM管理'
                },
                component: (resolve) => require(['./views/product/productbom.vue'], resolve)
            },
            {
                path: '/main/storage',
                name: 'storage',
                meta: {
                    title: '出入库详情'
                },
                component: (resolve) => require(['./views/warehouse/storage.vue'], resolve)
            },
            {
                path: '/main/onestorage/:id/type/:type',
                name: 'onestorage',
                meta: {
                    title: '出入库记录'
                },
                component: (resolve) => require(['./views/warehouse/onestorage.vue'], resolve)
            },
            {
                path: '/main/test1',
                name: 'test1',
                meta: {
                    title: 'test1',
                    id: 'test1'
                },
                component: (resolve) => require(['./views/test/test1.vue'], resolve)
            }
            /*{
                path: '/main/test2/test22',
                name: 'test22',
                meta: {
                    title: 'test2/test22',
                    id: 'test2'
                },
                component: (resolve) => require(['./views/test/test22.vue'], resolve)
            },
            {
                path: '/main/test23',
                name: 'test23',
                meta: {
                    title: 'test23'
                },
                component: (resolve) => require(['./views/test/test22.vue'], resolve)
            },
            {
                path: '/main/test3',
                name: 'test3',
                meta: {
                    title: 'test3'
                },
                component: (resolve) => require(['./views/test/test3.vue'], resolve)
            }*/
        ]
    },
    {
        path: '/qrcode/:id',
        name: 'qrcode',
        meta: {
            title: '二维码管理'
        },
        component: (resolve) => require(['./views/workorder/qrcode.vue'], resolve)
    },
    {
        path: '/shengchan/:id',
        name: 'shengchan',
        meta: {
            title: '生产码'
        },
        component: (resolve) => require(['./views/workorder/shengchan.vue'], resolve)
    },
    {
        path: '/baozhuang/:id',
        name: 'baozhuang',
        meta: {
            title: '包装码'
        },
        component: (resolve) => require(['./views/workorder/baozhuang.vue'], resolve)
    }
];
/*export const appRouter = [
    {
        path: '/access',
        icon: 'key',
        name: 'access',
        title: '权限管理',
        component: Main,
        children: [
            { path: 'index', title: '权限管理', name: 'access_index', component: resolve => { require(['./views/access/access.vue'], resolve); } }
        ]
    }
]*/
export default routers;
